﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace lcmyjobs.Web.findjobs
{
    public partial class ShowNews : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!string.IsNullOrEmpty(Request["type_id"]) && !string.IsNullOrEmpty(Request["nid"]))
                {
                    this.Title = string.Format("{1}新闻  {0}", Application["webname"].ToString(), Application["webregion"].ToString());
                    int typeid = Convert.ToInt32(Request["type_id"]);
                    int nid = Convert.ToInt32(Request["nid"]);

                    Bind(typeid,nid);
                }
            }
        }

        private void Bind(int typeid,int nid)
        {
            this.NewsList1.infourl = "../findjobs/ShowNews";
            this.NewsList1.para = "-" + typeid;
            this.NewsList1.linkname = "";
            this.NewsList1.linkurl = "";
            this.NewsList1.count = 15;
            this.NewsList1.typeid = typeid;


            if (typeid == 3)
            {
                this.lbl_titlel.Text = "就业指导资讯";
                this.lbl_titler.Text = "就业指导资讯";
            }
            if (typeid == 5)
            {
                this.lbl_titlel.Text = "招聘面试官资讯";
                this.lbl_titler.Text = "招聘面试官资讯";
            }
            if (typeid == 6)
            {
                this.lbl_titlel.Text = "校园活动•招聘会";
                this.lbl_titler.Text = "校园活动•招聘会";
            }
            if (typeid == 4)
            {
                this.lbl_titlel.Text = "职业规划";
                this.lbl_titler.Text = "职业规划";
            }
            if (typeid == 1)
            {
                this.lbl_titlel.Text = "网站公告";
                this.lbl_titler.Text = "职业规划";
            }
            if (typeid == 2)
            {
                this.lbl_titlel.Text = "招聘会•人才市场";
                this.lbl_titler.Text = "招聘会•人才市场";
            }
            if (typeid == 7)
            {
                this.lbl_titlel.Text = "悬赏资讯";
                this.lbl_titler.Text = "悬赏资讯";
            }
            if (typeid == 8)
            {
                this.lbl_titlel.Text = "猎头服务资讯";
                this.lbl_titler.Text = "猎头服务资讯";
            }
            if (typeid == 9)
            {
                this.lbl_titlel.Text = "热门文章";
                this.lbl_titler.Text = "热门文章";
            }
            if (typeid == 10)
            {
                this.lbl_titlel.Text = "推荐文章";
                this.lbl_titler.Text = "推荐文章";
            }


            if (nid != -1)
            {

                DataSet ds = new lcmyjobs.BLL.news().GetNews(nid);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    DataRow row = ds.Tables[0].Rows[0];

                    this.lbl_newsTitle.Text = row["ntitle"].ToString();
                    this.lbl_newsTime.Text = "发布时间：" + row["ntime"].ToString() + "作者：" + row["truename"].ToString();
                    this.lbl_content.Text = row["ncontent"].ToString();

                }
            }
            

           
        }
    }
}